﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QuanLyThongTinNhanKhau.model.BO
{
    class TKTATSBO
    {
        model.DAO.TKTATSDAO tkTATSDAO = new DAO.TKTATSDAO();
        private GUI.TKTATS f;

        public TKTATSBO(GUI.TKTATS tKTATS)
        {
            // TODO: Complete member initialization
            this.f = tKTATS;
        }

        internal void btnThongKe()
        {
            String fromDate = this.f.dateTimeFromDate.Value.Date.ToString("yyyy-MM-dd");
            String toDate = this.f.dateTimeToDate.Value.Date.ToString("yyyy-MM-dd");

            DataTable dt = tkTATSDAO.btnThongKe(fromDate, toDate);

            if (dt.Rows.Count != 0)
            {
                this.f.gridControlTATS.DataSource = dt;
            }
            else
            {
                this.f.gridControlTATS.DataSource = null;
            }
        }
    }
}
